package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.contracttemplate.LindiContractTemplateVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationtemplateconfirmletter.LindiTradeApplicationTemplateConfirmLetterQueryVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationtemplateconfirmletter.LindiTradeApplicationTemplateConfirmLetterVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiTradeApplicationTemplateConfirmLetterFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 林地指标交易平台_交易申请确认函模板Feign客户端
 *
 * @author minimalist
 * @since 2024-12-19
 */
@FeignClient(value = "minimalist-lindi"
        , contextId = "lindiTradeApplicationTemplateConfirmLetterFeignClient"
        , path = "/minimalist/lindi/tradeApplicationTemplateConfirmLetter"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiTradeApplicationTemplateConfirmLetterFeignClientFallbackFactory.class)
public interface LindiTradeApplicationTemplateConfirmLetterFeignClient{

    /**
     * 添加交易申请确认函模板
     *
     * @param tradeApplicationTemplateConfirmLetterVO 交易申请确认函模板VO
     * @return 响应结果
     */
    @PostMapping("/addTradeApplicationTemplateConfirmLetter")
    R<?> addTradeApplicationTemplateConfirmLetter(
            @RequestBody LindiTradeApplicationTemplateConfirmLetterVO tradeApplicationTemplateConfirmLetterVO);

    /**
     * 删除交易申请确认函模板 -> 根据交易申请确认函模板ID删除
     *
     * @param tradeApplicationTemplateConfirmLetterId 交易申请确认函模板ID
     * @return 响应结果
     */
    @DeleteMapping("/deleteTradeApplicationTemplateConfirmLetterByTradeApplicationTemplateConfirmLetterId")
    R<?> deleteTradeApplicationTemplateConfirmLetterByTradeApplicationTemplateConfirmLetterId(
            @RequestParam("tradeApplicationTemplateConfirmLetterId") Long tradeApplicationTemplateConfirmLetterId);

    /**
     * 修改交易申请确认函模板
     *
     * @param tradeApplicationTemplateConfirmLetterVO 交易申请确认函模板VO
     * @return 响应结果
     */
    @PutMapping("/updateTradeApplicationTemplateConfirmLetterByTradeApplicationTemplateConfirmLetterId")
    R<?> updateTradeApplicationTemplateConfirmLetterByTradeApplicationTemplateConfirmLetterId(
            @RequestBody LindiTradeApplicationTemplateConfirmLetterVO tradeApplicationTemplateConfirmLetterVO);

    /**
     * 查询交易申请确认函模板列表(分页)
     *
     * @param queryVO 查询条件
     * @return 分页响应结果
     */
    @GetMapping("/getPageTradeApplicationTemplateConfirmLetterList")
    R<PageResp<LindiTradeApplicationTemplateConfirmLetterVO>> getPageTradeApplicationTemplateConfirmLetterList(
            LindiTradeApplicationTemplateConfirmLetterQueryVO queryVO);

    /**
     * 根据交易申请确认函模板ID查询交易申请确认函模板
     *
     * @param tradeApplicationTemplateConfirmLetterId 交易申请确认函模板ID
     * @return 响应结果
     */
    @GetMapping("/getTradeApplicationTemplateConfirmLetterByTradeApplicationTemplateConfirmLetterId/{tradeApplicationTemplateConfirmLetterId}")
    R<LindiTradeApplicationTemplateConfirmLetterVO> getTradeApplicationTemplateConfirmLetterByTradeApplicationTemplateConfirmLetterId(
            @PathVariable("tradeApplicationTemplateConfirmLetterId") Long tradeApplicationTemplateConfirmLetterId);

    /**
     * 删除交易申请确认函模板文件 -> 根据文件ID删除
     *
     * @param fileId 文件ID
     * @return 响应结果
     */
    @PostMapping("/deleteTradeApplicationTemplateConfirmLetterFileByFileId")
    R<?> deleteTradeApplicationTemplateConfirmLetterFileByFileId(
            @RequestParam("fileId") Long fileId);

    /**
     * 获取合同模板列表
     *
     * @return 响应结果
     */
    @GetMapping("/getContractTemplateList")
    R<List<LindiContractTemplateVO>> getContractTemplateList();

    /**
     * 生成交易申请确认函模板
     *
     * @param tradeApplicationId      交易申请ID
     * @param confirmLetterTemplateId 确认函模板ID
     * @param confirmLetterType       确认函类型
     * @param createId                创建人ID
     * @param tenantId                租户ID
     * @return 响应结果
     */
    @PostMapping("/generateTemplateConfirmLetter")
    R<?> generateTemplateConfirmLetter(
            @RequestParam("tradeApplicationId") Long tradeApplicationId,
            @RequestParam("confirmLetterTemplateId") Long confirmLetterTemplateId,
            @RequestParam("confirmLetterType") String confirmLetterType,
            @RequestParam("createId") Long createId,
            @RequestParam("tenantId") Long tenantId);
}